using System;
using System.Collections;

using Game.Input;
using Game.Output;

namespace Game.Data
{
	public class C2FieldData
	{
		public struct DataSet 
		{
			public string id;
			public string val;
		}
		
		private string		m_path;
		private ArrayList	m_dataSets;
		
		public C2FieldData(string p_path)
		{
			CConsole.ReportClassInit(System.Reflection.MethodInfo.GetCurrentMethod().DeclaringType.Name);
			CConsole.ReportParam("p_path",  p_path);
			
			m_path		= p_path;
			m_dataSets	= new ArrayList();
		}
		
		public void Load()
		{
		}
		
		public void Add(string p_id, string p_value)
		{
			DataSet dataSet = new DataSet();
			
			dataSet.id	= p_id;
			dataSet.val	= p_value;
			
			m_dataSets.Add(dataSet);
		}
		
		public string Get(string p_id)
		{
			foreach (DataSet dataSet in m_dataSets)
			{
				if (dataSet.id == p_id)
				{
					return dataSet.val;
				}
			}

			throw new System.Exception("ID not found! Value cannot be evaluated!");
		}
	}
}
